package io.finer.erp.jeecg.purchase.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.finer.erp.jeecg.approve.entity.ApproveRecord;
import io.finer.erp.jeecg.purchase.entity.PurchaseRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import io.finer.erp.jeecg.purchase.entity.PurchaseRequestLine;
import io.finer.erp.jeecg.purchase.vo.PurchaseRequestPage;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采购申请 服务类
 * </p>
 *
 * @author yaoyifan
 * @since 2021-04-12
 */
public interface PurchaseRequestService extends IService<PurchaseRequest> {
    public IPage<PurchaseRequestPage> selectPurchaseRequestPage(Page page, @Param(Constants.WRAPPER) Wrapper<PurchaseRequestPage> queryWrapper);
    public PurchaseRequestPage selectPurchaseRequestPageById(@Param("id") String id);
    public void saveMain(PurchaseRequest purchaseRequest, List<PurchaseRequestLine> purchaseRequestLineList) ;
    public void updateMain(PurchaseRequest purchaseRequest, List<PurchaseRequestLine> purchaseRequestLineList);
    public void delMain(String id);
    public void delBatchMain(Collection<? extends Serializable> idList);
    public void submit(String model, String id);
    public String approve(String model, String id, String note);
    public void reject(String model, String id, String note);
    public boolean canApproveorReject(String model, String id);
    public Map<String, Boolean> canSubmitorWithdraworInvalid(String model, String id, IService<PurchaseRequest> service);
    public List<ApproveRecord> queryApproveRecordList(String model, String id);
    public void withDraw(String model, String id);
    public void invalid(String id, String note);
}
